# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=lxqt-openssh-askpass
pkgver=1.1.0
pkgrel=0
pkgdesc="GUI to query passwords on behalf of SSH agents"
url="https://github.com/lxqt/lxqt-openssh-askpass"
arch="all !armhf" # qt5
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools qt5-qtbase-dev
	qt5-qttools-dev liblxqt-dev kwindowsystem-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/lxqt-openssh-askpass/releases/download/$pkgver/lxqt-openssh-askpass-$pkgver.tar.xz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/lxqt//translations/$pkgname
}

sha512sums="
7909bb4deb2b0bce466e1cf89788d45e5e5b1db37d813f75d268ff7d36f26840f24ada0df55da1e605ba64aadde882ffdf800bfff38dcb4bda0205d64df320b9  lxqt-openssh-askpass-1.1.0.tar.xz
"
